package com.xc.file.config;

import com.xc.file.model.FileModel;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Hashtable;
import java.util.List;
import java.util.Map;


/**
 * <p>文件服务配置类</p>
 *
 * @author xc
 * @version v1.0.0
 */
@Data
@Component
@ConfigurationProperties(prefix = "xc.file")
public class Constants {
    /**
     * 服务唯一机器码，防止uuid重复
     */
    private String machineId = "";
    /**
     * 初始可用流量,默认10G
     */
    private long initFreeFlow = 10737418240L;
    /**
     * 初始网盘空间,默认10G
     */
    private long initCloudSpace = 10737418240L;

    /**
     * 目录信息
     */
    private List<FolderConfig> folderPaths;

    /**
     * 本机地址
     */
    private String localUrl;
    /**
     * 本地旧地址
     */
    private String localOldUrl;
    /**
     * 每次上传文件大小
     */
    private Long renewalSize = 10485760L;
    /**
     * <p>续传文件信息</p>
     * <p>非配置文件</p>
     */
    private Map<String, FileModel> fileInfoTable = new Hashtable<>();

    /**
     * 签名过期时间
     */
    private Long signExpiryTime = 1800000L;
    /**
     * 临时目录
     */
    private FolderConfig tempFolder;
    /**
     * 文件服务信息key
     */
    private String serverInfoKey = "serverInfo";
    /**
     * 默认下载url
     */
    private String openDownloadUrl = "/open/download/";
    /**
     * cdn下载url
     */
    private String openCndUrl = "/open/cdn/";

    /**
     * 根
     */
    private String root = "root";
}
